package com.szrt.javaweb.oa.department.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.szrt.javaweb.oa.department.entity.DepartmentEntity;
import com.szrt.javaweb.oa.department.service.DepartmentService;

@Controller
@RequestMapping("/department")
public class DepartmentController {
	
	@Autowired
	private DepartmentService service;
	
	// http://localhost:8080/ssm201609/department/add
	@ResponseBody
	@RequestMapping("/add")
	public Map<String,Object> add(DepartmentEntity entity){
		Map<String,Object> map = new HashMap<String,Object>();
		service.add(entity, map);
		System.out.println(map);
		return map;
	}
	

}
